void GameWindow::paintEvent(QPaintEvent *event) {
    QPainter painter(this);
    
    // 绘制背景
    painter.fillRect(rect(), Qt::black);
    
    // 绘制球
    painter.setBrush(Qt::white);
    painter.drawEllipse(ballPos, 10, 10);
    
    // 绘制挡板
    painter.setBrush(Qt::blue);
    painter.drawRect(paddle);
    
    // 绘制分数
    painter.setPen(Qt::white);
    painter.setFont(QFont("Arial", 16));
    painter.drawText(10, 30, QString("Score: %1").arg(score));
    
    // 游戏结束显示
    if (gameOver) {
        painter.setFont(QFont("Arial", 32));
        painter.drawText(rect(), Qt::AlignCenter, "Game Over\nPress R to Restart");
    }
}